	<!--{if $allowSearch}
	<div style="padding: 5px; width:auto; overflow:auto;">
		<div style="float:left;">Otsing: {$field}</div>{$button}
	</div>
	{/if}-->
<script type="text/javascript">
	grid_{$grid->name} = new DomFgGrid( {$grid->name} );
</script>
<div class="fg_gridBorder" style="{$grid->style}">
	<input type="hidden" id="{$grid->name}_orderBy" name="{$grid->name}[orderBy]" value="0" />
	<input type="hidden" id="{$grid->name}_orderByField" name="{$grid->name}[orderByField]" value="{$f->orderByField}" />
	<input type="hidden" id="{$grid->name}_orderByDirection" name="{$grid->name}[orderByDirection]" value="{$f->orderByDirection}" />
	
	<table class="fg_grid" cellpadding="0" cellspacing="0" border="0">
		
		<colgroup>
			{foreach item=f from=$fields}<col width="{$f->width}"/>{/foreach}
		</colgroup>
		
		<thead>
			<tr>
				{foreach item=f from=$headerFields}
					<td {if $f->orderByField}onclick="gridOrderBy('{$grid->name}','{$f->orderByField}', '{$f->orderByDirection}')" onmouseover="this.className='mouseOver'" onmouseout="this.className=''" style="cursor:pointer;"{/if} {if $f->colspan>1}colspan="{$f->colspan}"{/if}>
						<div>
							{if $currentOrderByField == $f->orderByField && $f->orderByField != ''}
								{if $f->orderByDirection=='ASC'}<span class="ascendingIcon"></span>{else}<span class="descendingIcon"></span>{/if}
							{/if}
							{$f->title}
						</div>
					</td>
				{/foreach}
			</tr>
		</thead>
		
		
		
		
		
		<tbody>
		
			{if $pager->hasPages()}
			<tr class="fg_pages">
				<td colspan="{$nrOfColumns}">
					{foreach item=n from=$pager->getPages() }
					<a href="{$n.link}" {if $n.selected}class="fg_selected"{/if} >{$n.name}</a>
					{/foreach}
					<div style="float:right; padding-left:10px;"><b>{$pager->getTotal()}</b></div>
				</td>
			</tr>
			{/if}
		
			{foreach key=k item=i from=$data}
			{if $k%2==0}{assign var=rowClass value="gridRowPaired"}{else}{assign var=rowClass value="gridRowUnPaired"}{/if}
			<tr class="{$rowClass}" onmouseover="this.className='{$rowClass} fg_rowMouseOver'" onmouseout="this.className='{$rowClass}'">
				{foreach item=f key=k from=$fields}
					<td style="{$i.$k.style}{if $i.$k.link};cursor:pointer{/if}" {if $i.$k.link}onclick="document.location='{$i.$k.link}'"{/if}>
						{$i.$k.value}
					</td>
				{/foreach}
			</tr>
			{foreachelse}
			<tr>
				<td colspan="{$nrOfColumns}">-</td>
			</tr>
			{/foreach}
			
			
			{if $pager->hasPages()}
			<tr class="fg_pages fg_bottomPages">
				<td colspan="{$nrOfColumns}">
					{foreach item=n from=$pager->getPages()}
					<a href="{$n.link}" {if $n.selected}class="fg_selected"{/if} >{$n.name}</a>
					{/foreach}
				</td>
			</tr>
			{/if}
		</tbody>
		
		
		
		
		
	</table>
</div>